ia.Theme Class
Contains information about a ia.Theme.
Constructor
ia.Theme
-
geography -
theme -
data
Parameters:
-
geographyia.GeographyThe geography the theme belongs to.
-
themeia.ThemeThe parent theme the theme belongs to or undefined if its a child of the geography.
-
dataJSONThe json data describing the object.
Item Index
Methods
- getChildren
- getComparisonData
- getComparisonDataForDate
- getData
- getDataForDate
- getDataTree
- getFeatureData
- getFirstIndicator
- getIndicator
- getIndicatorDates
- getIndicatorIds
- getIndicatorNames
- getIndicators
- getIndicators
- getNestedIndicator
- getParentThemes
- getProfileData
- getProperties
- getProperty
- getThemes
- loadData
- loadIndicator
- parseData
Methods
getChildren
()
Object
Returns an array of data objects that are children of this object.
Returns:
getComparisonData
-
indicatorId
Gets the themes indicator comparison data.
Parameters:
-
indicatorIdStringThe indicator id.
Returns:
getComparisonDataForDate
-
date
Gets the themes indicators with the given date.
Parameters:
-
dateStringThe date.
Returns:
getData
-
indicatorId -
featureIds
Gets the themes indicator data.
Parameters:
-
indicatorIdStringAn optional indicator id.
-
featureIdsStringAn optional list of feature ids to get data for.
Returns:
getDataForDate
-
date -
featureIds
Gets the themes indicator data with the given date.
Parameters:
-
dateStringThe date.
-
featureIdsStringAn optional list of feature ids to get data for.
Returns:
getDataTree
-
showDates -
reverseDates -
dataHash -
parentId
Returns an associative array of the form:
["i1"]{id:"i1"; label:"Home"; type:"branch"; children:["i2"; "i3"; "i4"]}
["i2"]{id:"i2"; label:"ia.Indicator 1"; type:"branch"; parent:"i1"; children:["i5"; "i6"; "i7"]}
["i5"]{id:"i5~2004"; label:"2004"; type:"leaf"; parent:"i2"}
Used by data explorers. Dates are returned as part of the tree.
Parameters:
-
showDatesBooleanShould the dates be displayed.
-
reverseDatesBooleanShould the dates be reversed.
-
dataHashAssociative ArrayAn associative array as described.
-
parentIdStringThe parent id.
getFeatureData
-
feature -
date
A hashtable of the indicators/associates for a feature - used by feature card.
Parameters:
-
featureObjectA feature object.
-
dateStringAn optional date.
Returns:
getFirstIndicator
-
reverseDates
Returns the first indicator - this can be within a nested ia.Theme. Where dates are used the first indicator is the one with the most recent date
Parameters:
-
reverseDatesBooleanShould the dates be reversed.
Returns:
getIndicator
-
id -
date -
reverseDates
Returns the indicator that corresponds to the id and date provided. Will include the latest date of an indicator if the specified date is unavailable.
Parameters:
-
idStringThe indicator id.
-
dateStringAn optional date.
-
reverseDatesBooleanShould the dates be reversed.
Returns:
getIndicatorDates
-
indicatorId
Returns a list of dates for the indicator that matches the id provided.
Parameters:
-
indicatorIdStringThe indicator id.
Returns:
getIndicatorIds
()
String
Returns a list of indicator ids contained in the theme.
Returns:
getIndicatorNames
()
String
Returns a list of indicator names contained in the theme.
Returns:
getIndicators
-
date
Returns the indicators with the given date. Will include the latest date of an indicator if the specified date is unavailable.
Parameters:
-
dateStringThe date.
Returns:
getIndicators
-
indicatorId
Returns the indicators contained in the theme or with the given id if that is supplied.
Parameters:
-
indicatorIdStringAn optional indicator id.
Returns:
getNestedIndicator
-
id -
date -
reverseDates
Includes indicators in nested themes.
Parameters:
-
idStringThe indicator id.
-
dateStringAn optional date.
-
reverseDatesBooleanShould the dates be reversed.
Returns:
getParentThemes
()
ia.Theme[]
Returns a list of the parent theme names including this one.
Returns:
getProfileData
-
featureIds -
themeArray -
date -
useLatestDate
A hashtable of the indicators/associates for a feature - used for profiles.
The returned data has the following structure:
["t0"]{id:"t0", name:"theme0", type:"parent"}
["i0"]{id:"i0", name:"indicator0", value:2345, value_formatted:2345, associate1:25, associate1_formatted:25, type:"leaf"}
["i1"]{id:"i1", name:"indicator1", value:4347, value_formatted:4347, associate1:45, associate1_formatted:45, type:"leaf"}
["i2"]{id:"i2", name:"indicator1", value:2496, value_formatted:2496, associate1:25, associate1_formatted:25, type:"leaf"}
Parameters:
-
featureIdsStringA list of feature ids to get data for.
-
themeArrayObjectThe array to add the theme objects to.
-
dateStringAn optional date.
-
useLatestDateBooleanUse the latest date if the specified date is unavailable?
getProperties
()
Associative Array
Returns the custom properties. An associative array of the form: [propName] = propValue.
Returns:
getProperty
-
propName
Returns a value for a custom property.
Parameters:
-
propNameStringThe name of the property.
Returns:
getThemes
()
ia.Theme[]
Returns the themes contained in the ia.Theme.
Returns:
loadData
-
callbackFnc
Loads all data in the theme.
Parameters:
-
callbackFncFunctionThe callbackFnc gets called with the loaded object as the parameter.
loadIndicator
-
id -
date -
callbackFnc
Loads the indicator that corresponds to the id and date provided. The indicator can be in a nested ia.Theme. Returns the indicator via the supplied callback function.
Parameters:
-
idStringThe indicator id.
-
dateStringAn optional date.
-
callbackFncFunctionThe callbackFnc gets called with the loaded object as the parameter.
parseData
-
data
Parses the JSON data.
Parameters:
-
dataJSONThe json data describing the object.
Properties
customColumns
Object} Array of columns.
The custom columns that can be used in the data table.
data
JSON
The raw json data describing the object.
fileName
String
The file name.
hasData
Boolean
Indicates if this object contains data.
Default: true
hasThemes
Boolean
Indicates if this theme contains nested themes.
Default: false
href
String
The href.
id
String
The id.
name
String
The name.
parent
Object
The parent object.
precision
Number
The precision. Inherited from parent if undefined.
type
Number
The data type. Inherited from parent if undefined.
Default: "categoric"